<html><!doctype html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-touch-fullscreen" content="yes">
    <title>KISSY ScrollView</title>
    <script src="../../../../../../g.alicdn.com/kissy/k/1.4.7/seed.js" tppabs="http://g.alicdn.com/kissy/k/1.4.7/seed.js" data-config="{combine:true}"></script>
    <script src="../../../../../../g.alicdn.com/kissy/k/1.4.7/scroll-view/base-min.js" tppabs="http://g.alicdn.com/kissy/k/1.4.7/scroll-view/base-min.js"></script>
    <link rel="stylesheet" href="assets/nice.css" tppabs="http://docs.kissyui.com/1.4/source/raw/demo/scroll-view/assets/nice.css">
    <style>
        .ks-scroll-view {
            border: 1px solid red;
            margin: 0 auto;
        }

        .ks-scroll-view p {
            height: 90px;
            border: 1px solid green;
            margin: 10px;
            padding: 10px;
            text-align: center;
            line-height: 90px;
        }

        h1 {
            text-align: center;
            /*margin-bottom: 20px;*/
        }
    </style>
</head>
<body>
<h1>KISSY ScrollView</h1>
<button id="destroy">destroy</button>
<script>
    KISSY.use('scroll-view', function (S, ScrollView) {
        var content = '';
        for (var i = 0; i < 10; i++) {
            content += '<p>This is ' + i + ' block</p>';
        }

        var scrollView = new ScrollView({
            width: 320,
            height: 219,
            content: content,
        }).render();

        S.all('#destroy').on('click', function () {
            scrollView.destroy();
            S.all('#destroy').attr('disabled', true);
        });
    });
</script>
</body>
</html>